From: Claudio Cambra Date: Thu, 3 Apr 2025 07:39:41 +0000 (+0800) Subject: fix(mac-crafter): Work around broken consecutive shell integration builds X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2^2~52^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=48186f136356ea48e0e92d4b08fd9f8e6f551d1b;p=nextcloud-desktop.git fix(mac-crafter): Work around broken consecutive shell integration builds Signed-off-by: Claudio Cambra --- diff --git a/admin/osx/mac-crafter/Sources/main.swift b/admin/osx/mac-crafter/Sources/main.swift index f7d723b80..f659c82c5 100644 --- a/admin/osx/mac-crafter/Sources/main.swift +++ b/admin/osx/mac-crafter/Sources/main.swift @@ -208,21 +208,33 @@ struct Build: ParsableCommand { ) } - print("Crafting \(appName) Desktop Client...") - - let allOptionsString = craftOptions.map({ "--options \"\($0)\"" }).joined(separator: " ") - let clientBuildDir = "\(buildPath)/\(craftTarget)/build/\(craftBlueprintName)" + print("Crafting \(appName) Desktop Client...") if fullRebuild { do { try fm.removeItem(atPath: clientBuildDir) } catch let error { print("WARNING! Error removing build directory: \(error)") } + } else { + // HACK: When building the client we often run into issues with the shell integration + // component -- particularly the FileProviderExt part. So we wipe out the build + // artifacts so this part gets build first. Let's first check if we have an existing + // build in the folder we expect + let shellIntegrationDir = "\(clientBuildDir)/work/build/shell_integration/MacOSX" + if fm.fileExists(atPath: shellIntegrationDir) { + print("Removing existing shell integration build artifacts...") + do { + try fm.removeItem(atPath: shellIntegrationDir) + } catch let error { + print("WARNING! Error removing shell integration build directory: \(error)") + } + } } let buildMode = fullRebuild ? "-i" : disableAppBundle ? "compile" : "--compile --install" let offlineMode = offline ? "--offline" : "" + let allOptionsString = craftOptions.map({ "--options \"\($0)\"" }).joined(separator: " ") guard shell( "\(craftCommand) --buildtype \(buildType) \(buildMode) \(offlineMode) \(allOptionsString) \(craftBlueprintName)" ) == 0 else {